package linkedList;

import java.util.Scanner;

public class lianbiao {

    public static void main(String[] str) {
        Node head = new Node();
        LinkList list = new LinkList();
        int n, num;
        int m = 1;
        head.next = null;
        Scanner in = new Scanner(System.in);
        while (m != 0) {
            System.out.println();
            System.out.println("***************************");
            System.out.println("");
            System.out.println("");
            System.out.println("");
            System.out.println("");
            System.out.println("***************************");
            System.out.println();
            System.out.print("the choice :");
            m = in.nextInt();
            switch (m) {

                case 1: {
                    System.out.println("起始站:cd  终点站:cq  起止时间: 8:00am  时长:0.5h  票价:200元");
                    System.out.println("起始站:cd  终点站:wh  起止时间: 8:00am  时长:1.5h  票价:400元");
                    System.out.println("起始站:cd  终点站:gy  起止时间: 8:00am  时长:1h    票价:600元");
                    System.out.println("起始站:cd  终点站:km  起止时间: 8:00am  时长:1h    票价:1000元");
                    System.out.println("起始站:cd  终点站:bj  起止时间: 8:00am  时长:3h    票价:500元");
                    System.out.println("起始站:cd  终点站:cs  起止时间: 8:00am  时长:1.5h  票价:1000元");
                    System.out.println("起始站:cd  终点站:sh  起止时间: 8:00am  时长:3h    票价:1100元");
                    System.out.println("起始站:cd  终点站:hz  起止时间: 8:00am  时长:3h    票价:900元");
                    System.out.println("起始站:cd  终点站:nj  起止时间: 8:00am  时长:2.5h  票价:900元");
                    System.out.println("起始站:cd  终点站:zz  起止时间: 8:00am  时长:2h    票价:400元");
                    System.out.println("起始站:cd  终点站:xa  起止时间: 8:00am  时长:1h    票价:400元");
                    System.out.println("起始站:cd  终点站:lz  起止时间: 8:00am  时长:1.5h  票价:400元");
                    System.out.println("起始站:cq  终点站:wh  起止时间:10:00am  时长:1.5h  票价:300元");
                    System.out.println("起始站:cq  终点站:km  起止时间:10:00am  时长:1h    票价:1000元");
                    System.out.println("起始站:cq  终点站:bj  起止时间:10:00am  时长:3h    票价:300元");
                    System.out.println("起始站:cq  终点站:cs  起止时间:10:00am  时长:1h    票价:300元");
                    System.out.println("起始站:cq  终点站:xa  起止时间:10:00am  时长:1h    票价:500元");
                    System.out.println("起始站:wh  终点站:bj  起止时间:12:00am  时长:2h    票价:300元");
                    System.out.println("起始站:wh  终点站:zz  起止时间:12:00am  时长:1h    票价:300元");
                    System.out.println("起始站:gy  终点站:km  起止时间:10:00am  时长:1h    票价:1100元");
                    System.out.println("起始站:gy  终点站:bj  起止时间:10:00am  时长:3h    票价:400元");
                    System.out.println("起始站:gy  终点站:cs  起止时间:10:00am  时长:1.5h  票价:1200元");
                    System.out.println("起始站:km  终点站:bj  起止时间:10:00am  时长:4h    票价:800元");
                    System.out.println("起始站:km  终点站:cs  起止时间:10:00am  时长:2.5h  票价:800元");
                    System.out.println("起始站:km  终点站:xa  起止时间:10:00am  时长:2.5h  票价:900元");
                    System.out.println("起始站:nc  终点站:bj  起止时间: 9:00am  时长:2.5h  票价:200元");
                    System.out.println("起始站:nc  终点站:cs  起止时间:10:00am  时长:0.5h  票价:300元");
                    System.out.println("起始站:nc  终点站:sh  起止时间:10:00am  时长:1.5h  票价:500元");
                    System.out.println("起始站:bj  终点站:sh  起止时间:12:00am  时长:2.5h  票价:500元");
                    System.out.println("起始站:bj  终点站:hz  起止时间:12:00am  时长:2.5h  票价:400元");
                    System.out.println("起始站:bj  终点站:nj  起止时间:12:00am  时长:2h    票价:300元");
                    System.out.println("起始站:bj  终点站:zz  起止时间:12:00am  时长:1h    票价:400元");
                    System.out.println("起始站:bj  终点站:xa  起止时间:12:00am  时长:1.5h  票价:500元");
                    System.out.println("起始站:bj  终点站:lz  起止时间:12:00am  时长:2h    票价:300元");
                    System.out.println("起始站:cs  终点站:zz  起止时间:10:00am  时长:1h    票价:300元");
                    System.out.println("起始站:cs  终点站:xa  起止时间:10:00am  时长:1h    票价:500元");
                    System.out.println("起始站:sh  终点站:xa  起止时间:12:00am  时长:2h    票价:500元");
                    System.out.println("起始站:sh  终点站:lz  起止时间:12:00am  时长:3h    票价:1100元");
                    System.out.println("起始站:sh  终点站:lz  起止时间:12:00am  时长:3h    票价:1100元");
                    n = in.nextInt();
                    head = list.creat(n);
                    System.out.println("Input Complete.");
                    System.out.println();
                    System.out.println("print all nodes");
                    list.print(head);
                    System.out.println("Print Complete.");
                    break;

                }
                case 2: {
                    System.out.print("Input the delete node c:");
                    num = in.nextInt();
                    head = list.Delete(head, num);
                    System.out.println();
                    System.out.println("print all nodes");
                    list.print(head);
                    System.out.println("Print Complete.");
                    break;

                }
                case 3: {
                    head = list.add(head);
                    System.out.println();
                    System.out.println("print all nodes");
                    list.print(head);
                    System.out.println("Print Complete.");
                    break;

                }
                default:
                    System.out.println("Your choice is wrong.Please choice again!");
            }
        }
    }
}